package com.system.service;

import com.system.dao.DepartmentMapper;
import com.system.pojo.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by 陈文杰 on 2022/6/5 17:45
 */
//@Service
public class DepartmentServiceImpl implements DepartmentService {


//    @Autowired
    private DepartmentMapper departmentMapper;


    public void setDepartmentMapper(DepartmentMapper departmentMapper) {
        this.departmentMapper = departmentMapper;
    }

    @Override
    public List<com.system.pojo.Department> queryDeptAll() {
        return departmentMapper.queryDeptAll();
    }

    @Override
    public Department queryDeptByName(String deptName) {
        return departmentMapper.queryDeptByName(deptName);
    }

    @Override
    public Department queryDeptById(int deptId) {
        return departmentMapper.queryDeptById(deptId);
    }

    @Override
    public int addDepartment(Department department) {
        return departmentMapper.addDepartment(department);
    }

    @Override
    public int updateDepartmentById(Map<String,Object> map) {
        return departmentMapper.updateDepartmentById( map);
    }

    @Override
    public int updateDepartmentByName(Map<String,Object> map) {
        return departmentMapper.updateDepartmentByName(map
        );
    }

    @Override
    public int deleteDepartmentById(int deptId) {
        return departmentMapper.deleteDepartmentById(deptId);
    }

    @Override
    public int deleteDepartmentByName(String deptName) {
        return departmentMapper.deleteDepartmentByName(deptName);
    }


}
